﻿global using NotifyCenter.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using NotifyCenter.Basic;

namespace NotifyCenter.EntityFrameworkCore;

public static class EntityTypeBuilderExtensions
{ 
    public static EntityTypeBuilder<TEntity> Configure<TEntity>(this EntityTypeBuilder<TEntity> builder) where TEntity: Entity
    {
        builder.Property(x => x.Id)
            .HasValueGenerator<LongIdValueGenerator>();
        builder.HasKey(x => x.Id);

        return builder;
    }
}